<?php
/*
 * Created on 22/08/2007
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 ?>
 <?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>
 <?php use_helper('Javascript')?>
      <table width="850" border="0" align="center" id="externa">
        <tr>
          <td valign="top"><fieldset>
            <legend>Registrar Cita</legend>
            <form name="form_solicitarcitas" method="post" action="">
              <table width="800" height="335" align="center">
                <tr bgcolor="#e1e1e1">
                  <td height="10" colspan="4" class="estilo1">Datos Personales</td>
                </tr>
                <?
         			$id_est  = 2;
         			$objCita = new Cita();
         			$ced     = $objCita->getCedulaEstudianteConId($id_est);
         			$objEstudiante = new Estudiante();
         			$datos = $objEstudiante->getDatosDelEstudianteConCed($ced);
         			$n = $datos->getNombre();
         			$a = $datos->getApellido();
         			$c = $datos->getCedula();
         			$t = $datos->getTelefonoCelular();
      				?>
                <tr align="left">
                  <td width="126" height="15">&nbsp;</td>
                  <td height="15" colspan="2">&nbsp;</td>
                  <td width="238" rowspan="5" align="left">
                  <?php echo image_tag('fotos/linux2.gif', 'alt=imagen size=130x130') ?>
                  </td>
                </tr>
                <tr align="left">
                  <td height="27">C&eacute;dula:</td>
                  <td height="27" colspan="2">
                    <?echo $c?>

                </tr>
                <tr align="left">
                  <td height="25">Nombre:
                    <?
          $c1 = new Criteria();
          $this->decanato = DecanatoPeer::doSelect($c1);
          echo select_tag('decanato',objects_for_select($this->decanato, 'getCpDecanato', 'getNombre'),array(
			'onChange' => remote_function(array(
          	  'update'   => 'lin_programa',
              'url'      => 'solicitarcitas/ajax',
  			  'with' => "'ajax=1&decanato='+this.value"
			  )))
			);
          ?>
          <tr id="lin_programa" clas="clase">
          <td>Programa:</td>
          <td colspan="6">
		  <?
          echo select_tag('programa');
          ?>
          </td>
           </tr>
                  </td>
                  <td colspan="2">
                    <?echo $n?>
                  </td>
                </tr>
                <tr align="left">
                  <td height="11">Apellido:</td>
                  <td colspan="2"><?echo $a?></td>
                </tr>
                <tr align="left">
                  <td height="28">Tel&eacute;fono:</td>
                  <td colspan="2"><?echo $t?></td>
                </tr>
                <tr>
                  <td height="10"></td>
                  <td height="10" colspan="3"></td>
                </tr>
                <tr bgcolor="#e1e1e1">
                  <td height="10" colspan="4" class="estilo1">Datos De Solicitud</td>
                </tr>
                <tr>
                  <td height="28">Fecha:</td>
                  <td width="353">
                   <? echo input_date_tag('fecha',date('Y-m-d'),'rich=true' ) ?>
                  </td>
                  <td width="63">Especialista:</td>
                  <td><select name="especialista" aling="top">
          			<option  selected>Especialistas</option>
          			<?
         			 $objsDatoPersonal = new DatoPersonal();
          			 $especialistas = $objsDatoPersonal->getObjsUsuariosConUnRolId(4);
					  foreach($especialistas as $regcar)
    			      {?>
   				       <option>
     			       <?
     			       echo $regcar->getNombreCompleto();
				       ?>
 			           </option>
  				       <?}
  				       ?>
 			          </select>
                 </td>
                </tr>
                <tr>
                  <td height="22">Especialidad: </td>
                  <td>
                    <select name="especialidad">
          			<option selected>Especialidades</option>
          			<?
          			$objsRol = new Rol();
          			$especialidades = $objsRol->getRolesDeEspecialistas();
           			foreach($especialidades as $regcar)
          			{?>
            		<option><? echo trim($regcar->getDescripcion()); ?></option>
          			<?}
            		?>
          		    </select>
                  </td>
                  <td>&nbsp;Turno:</td>
                  <td>&nbsp;
                  <?
          			//$blq = $objCita->getObjsBloquesDisponiblesDeEspecialista(1,'2007-08-31');
          			//echo $blq[1]->getHoras();
          			//foreach($blq as $regdec)
          			//{
          			//   echo $regdec->getHoras();
          			//}

          			$blq = $objCita->getObjsBloquesDisponiblesDeEspecialista(1,'2007-08-30',1);
          		  ?>
					<select name="horas" >
            		<option selected>Horas</option>
          			<?
          			foreach($blq as $regdec)
          			{
          			echo ' '.$regdec->getHoras();
          			?>
          			<option><? echo $regdec->getHoras() ?></option>
          			<?
          			}?>
            		</select>
                  </td>
                </tr>
                <tr>
                  <td height="28">Motivo de la Cita:</td>
                  <td colspan="3"><textarea name="motivo" cols="50" rows="2" wrap="VIRTUAL"></textarea></td>
                </tr>
                <tr>
                  <td height="28">Tipo de Cita:</td>
                  <td><select name="tipo" onChange="MM_jumpMenu('parent',this,0)">
                      <option>Tipo de Cita</option>
                      <option selected>Exploratoria</option>
                      <option>Seguimiento</option>
                    </select></td>
                  <td></td>
                  <td>
                </tr>
                <tr>
                  <td colspan="4" align="center"><input id="boton" type="submit" name="Submit2" value="Registrar">
                      <input id="boton" type="submit" name="Submit3" value="Imprimir">
                      <input id="boton" type="submit" name="Submit4" value="Modificar">
                      <input id="boton" type="reset" name="Submit" value="Cancelar"></td>
                </tr>
              </table>
            </form>
          </fieldset></td>
         </tr>
      </table>